home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
workbench
/
mvtime
/
source
/
crono.amos
/
crono.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1999-12-06
|
4KB
|
133 lines
Rem ***************************************************************
Rem *
Rem * Crono My Time: a simple timer with an Arexx port
Rem *
Rem * v 1.0 - 27/11/1999 First pubblic release
Rem *
Rem * � Vettorello Marco 1999
Rem *
Rem * You can use it at your own risk! I'm not responsable of any
Rem * damage arising from the use/abuse/misuse of this software!!
Rem * You can change the code BUT you MUST give credits to me
Rem * Permission is allowed only to use or adapt this code only
Rem * for FREEWARE software
Rem *
Rem * Suggestion: try to procedure it in order to save space.
Rem *
Rem ***************************************************************
'Load "AMOSPro_System:My_Program/_MISC/crono.abk",20
Extension_24_0080 1
Extension_24_02C8
Extension_24_03D6
Extension_24_0018 1,1,20
Extension_24_0402 1," ","Crono my time � 1999 Vettorello Marco. Freeware"
If Arexx Exist("MVTIME")
A= Extension_24_0150("Message","MVTIME IS ALREADY RUNNING"+Chr$(10)+"THERE CAN BE ONLY ONE COPY RUNNING!!","ARGH!!")
End
End If
Arexx Open "MVTIME"
Do
GW= Extension_24_0034
If GW=-1
Exit
End If
If GW=1
Rem reset
_READY$="0:0:0"
Extension_24_009E 1,0,0,Varptr(_READY$)
End If
If GW=2
FIRS$= Extension_10_02C4 : Rem acquisiamo che ore sono adesso
HF=Val(Left$(FIRS$,2))
MF=Val(Mid$(FIRS$,3,2))
SF=Val(Right$(FIRS$,2))
DS=60-SF
DM=60-MF
DH=24-HF
Extension_24_0402 1,"Running","Crono my time � 1999 Vettorello Marco. Freeware"
While Extension_24_0484 <>2
Extension_24_08C4 50
NOW$= Extension_10_02C4
HN=Val(Left$(NOW$,2))
MN=Val(Mid$(NOW$,3,2))
SN=Val(Right$(NOW$,2))
If SN<SF
SS$=Str$(SN+DS)-" "
MN=MN-1
Else
SS$=Str$(SN-SF)-" "
End If
If MN<MF
MM$=Str$(MN+DM)-" "
Else
MM$=Str$(MN-MF)-" "
End If
If HN<HF
HH$=Str$(HN+DH)-" "
Else
HH$=Str$(HN-HF)-" "
End If
_T$=(HH$+":"+MM$+":"+SS$)-" "
Extension_24_009E 1,0,0,Varptr(_T$)
Wend
Extension_24_0402 1,"Stopped","Crono my time � 1999 Vettorello Marco. Freeware"
End If
If GW=-10
If Arexx=2
CMD$=Arexx$(0)
CMD$= Extension_10_0520(1,CMD$)
If CMD$="start"
Arexx Answer 0,"start"+Chr$(0)
FIRS$= Extension_10_02C4
HF=Val(Left$(FIRS$,2))
MF=Val(Mid$(FIRS$,3,2))
SF=Val(Right$(FIRS$,2))
DS=60-SF
DM=60-MF
DH=24-HF
Extension_24_0402 1,"Running","Crono my time � 1999 Vettorello Marco. Freeware"
While Extension_24_0484 <>-10 and Arexx<>2 and Arexx$(0)<>"stop"
Extension_24_08C4 50
NOW$= Extension_10_02C4
HN=Val(Left$(NOW$,2))
MN=Val(Mid$(NOW$,3,2))
SN=Val(Right$(NOW$,2))
If SN<SF
SS$=Str$(SN+DS)-" "
MN=MN-1
Else
SS$=Str$(SN-SF)-" "
End If
If MN<MF
MM$=Str$(MN+DM)-" "
Else
MM$=Str$(MN-MF)-" "
End If
If HN<HF
HH$=Str$(HN+DH)-" "
Else
HH$=Str$(HN-HF)-" "
End If
_T$=(HH$+":"+MM$+":"+SS$)-" "
Extension_24_009E 1,0,0,Varptr(_T$)
Wend
Arexx Answer 0,Chr$(0)
Extension_24_0402 1,"Stopped","Crono my time � 1999 Vettorello Marco. Freeware"
Else If CMD$="reset"
_READY$="0:0:0"
Extension_24_009E 1,0,0,Varptr(_READY$)
Arexx Answer 0,"reset"+Chr$(0)
Else If CMD$="quit"
Arexx Answer 0,"bye"+Chr$(0)
Exit
Else
Arexx Answer 0,"No such command!"+Chr$(0)
End If
End If
End If
Loop
Extension_24_0130
Arexx Close
End